package com.dhnsoft.代码随想录.字符串;

/**
 * ClassName: d03_替换数字
 * Package: com.dhnsoft.代码随想录.字符串
 * Description:
 *
 * @Author dhn
 * @Create 2024/3/19 9:09
 * @Version 1.0
 */
public class d03_替换数字 {
    public static void main(String[] args) {
        String a1b2c3 = replaceNums("a1b2c3");
        System.out.println(a1b2c3);
    }

    public static String replaceNums(String str){
        StringBuffer sb = new StringBuffer();
        char[] chars = str.toCharArray();
        for (char aChar : chars) {
            if(aChar>'0'&&aChar<'9'){
                sb.append("number");
            }
            else{
                sb.append(aChar);
            }
        }
        return sb.toString();
    }
}
